<template>
  <div style="width: 100%;height: 100%" ref="el"></div>
</template>


<script setup lang="ts">
import * as echarts from 'echarts';
import { onMounted, ref, defineProps } from 'vue';
const props = defineProps<{
  options: echarts.EChartsCoreOption
}>()
const el = ref();
onMounted(() => {
  const myChart = echarts.init(el.value);
  myChart.setOption(props.options);

  window.addEventListener('resize', () => {
    myChart.resize()
  })
})

</script>